package java.util
{
	import mx.collections.ArrayCollection;
	import mx.events.IndexChangedEvent;
	
	public class Vector extends ArrayCollection
	{
		
		private var _array:Array = new Array();
		
		public function Vector() {
			super();
		}
		
		public function size():int {
			return _array.length;
		}
		
		public function elementAt(index:int) {
			return _array[index];
		}
		
		public function setElementAt(object:Object, index:int):void {
			_array[index] = object;
		} 
		
		public function setSize(newsize:int):void {
			// nothing
		}
		
		public function addElement(element:Object):void {
			_array.push(element);
		}
		
		public function elements():Enumerator {
			return new Enumerator(_array);
		}

		public function removeElementAt(index:int):void {
			var tempArray:Array = new Array(_array.length-1);
			var posCounter:uint = 0;
			for(var i:uint=0;i<_array.length;i++) {
				if(i != index) {
					tempArray[posCounter] = _array[i];
					posCounter++;
				}
			}
			_array = tempArray;
		}

	}
}